package cn.fboost.mtos.dto.request;

import lombok.Data;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;

/**
 * 创建商品请求实体
 */
@Data
public class ProductCreateRequest {
    @NotNull(message = "分类ID不能为空")
    @Positive(message = "分类ID有误")
    private Integer categoryId;
    @NotBlank(message = "商品名称不能为空")
    private String name;

    @NotNull(message = "价格不能为空")
    @DecimalMin(value = "0.01", message = "价格不能小于0.01")
    private Double price;

    @NotBlank(message = "商品图片不能为空")
    private String image;

    private String describe;
}
